[#escape x as (x)!?html]
<div class="col-sm-4 px-4 d-none d-lg-block">
  <h5 class="ml-2"><i class="far fa-newspaper text-primary"></i> 热点关注</h5>
  <div class="px-2 pb-2 mt-3">
    [@ZContentList orderBy='count.views_desc' count='10'; contents] [#list
    contents as content]
    <div class="mt-3 d-flex flex-row">
      <div>
        <span
          class="badge [#if content_index==0]badge-danger[#elseif content_index<=2]badge-warning text-white[#elseif content_index<=4]badge-primary[#else]badge-secondary[/#if]"
          style="width: 25px"
          >${content_index+1}</span
        >
      </div>
      <div class="ml-2 text-truncate">
        [@ZUrl object=content class="common-link text-md-left"/]
      </div>
    </div>
    [/#list] [/@ZContentList]
  </div>
  [#include 'inc_index_imgblock.html'/]
  [#if config.grade>0]
  <h5 class="mt-3 ml-2">
    <i class="fas fa-poll text-primary"></i>
    <a href="${base}/vote" class="text-reset text-decoration-none">投票</a>
  </h5>
  <div class="px-3">
    [@ZVoteList count='1';list] [#list list as vote]
    <div class="text-center">
      <a href="${base}/vote/${vote.id?c}">${vote.title}</a>
    </div>
    <form id="voteForm" action="${api}/vote/vote" method="post">
      <div class="mt-2 small check-group">
        [#list vote.items as item]
        <div class="form-check mt-1">
          <input
            class="form-check-input"
            type="${vote.voteMultiple?string('checkbox','radio')}"
            name="items"
            id="vote-${vote.id?c}-${item_index?c}"
            value="${item.id?c}"
            required
          />
          <label
            class="form-check-label"
            for="vote-${vote.id?c}-${item_index?c}"
          >
            ${item.title}
          </label>
        </div>
        [/#list]
      </div>
      <div class="mt-2 text-center">
        <button type="submit" class="btn btn-primary btn-sm">投票</button>
        <a
          href="${base}/vote/${vote.id?c}/result"
          class="ml-2 btn btn-outline-danger btn-sm"
          >查看</a
        >
      </div>
      <input type="hidden" name="id" value="${vote.id?c}" />
    </form>
    [/#list] [/@ZVoteList]
  </div>
  <script>
    $("#voteForm").validate({
      submitHandler: function (form) {
        event.preventDefault();
        const formData = $(form).serializeJSON();
        const token = sessionStorage.getItem("accessToken");
        axios
          .post(form.action, formData, {
            headers: {
              "Tenant-Id": Cms.getTenantId(),
              Authorization: "Bearer " + token,
            },
          })
          .then(function (response) {
            if (response.data.code === 0) {
              alertShow("投票成功！");
              $("#voteForm")[0].reset();
            } else {
              alertShow(response.data.msg);
              $("#voteForm")[0].reset();
            }
          });
      },
    });
  </script>
  [/#if]
  [#if config.grade>0]
  <h5 class="mt-3 ml-2">
    <i class="far fa-clipboard text-primary"></i> <a href="${base}/investigate" class="text-reset text-decoration-none">网络调查</a>
  </h5>
  <div class="px-2 pb-2 mt-3">
    [@ZInvestigateList count='3'; investList]
    [#list investList as invest]
    <div class="mt-2 d-flex flex-row">
      <div class="ml-2 text-truncate position-relative"><a href="${base}/investigate/${invest.id?c}" class="cm-link small cm-dot-primary">${invest.title}</a></div>
    </div>
    [/#list]
    [/@ZInvestigateList]
  </div>
  [/#if]
  [#if config.grade>0]
  <h5 class="mt-3 ml-2">
    <i class="far fa-address-card text-primary"></i> <a href="${base}/duty" class="text-reset text-decoration-none">值班信息</a>
  </h5>
  <div class="px-2 pb-2 mt-3">
    [@ZDutyList count='10' today='true'; dutyList]
    <div class="ml-2 text-truncate position-relative">
      <span class=" cm-dot-primary mr-2" >部门</span>
      <span class=" cm-dot-primary mr-2">人员</span>
      <span class=" cm-dot-primary mr-2">电话</span>
    </div>
    [#list dutyList as duty]
    <div class="mt-2 d-flex flex-row">
      <div class="ml-2 text-truncate position-relative">
        <span class="small cm-dot-primary mr-2">${duty.deptName}</span>
        <span class="small cm-dot-primary mr-2">${duty.name}</span>
        <span class="small cm-dot-primary mr-2">${duty.contactPhone}</span>
      </div>
    </div>
    [/#list]
    [/@ZDutyList]
  </div>
  [/#if]
  [#if config.grade>1]
  <div class="share" >
    <div class="help">
      <a class="link-floatnav-service"   href="${base}/robot" target="_blank" title="智能客服，是您贴心的智能助手；给您带来易懂好用、随手可得的智能新体验"></a>
      <span>智能客服</span>
    </div>
  </div>
  [/#if]
  [#if config.grade>0]
  <h5 class="mt-3 ml-2">
    <i class="far fa-address-card text-primary"></i>部门积分
  </h5>
  <div class="px-2 pb-2 mt-3">
    [@ZContentScoreStat count='10' statGroup='dept' day='7'; depts]
    <div class="ml-2 text-truncate position-relative">
      <span class=" cm-dot-primary mr-2" >部门</span>
      <span class=" cm-dot-primary mr-2">发布数</span>
      <span class=" cm-dot-primary mr-2">分值</span>
    </div>
    [#list depts as dept]
    <div class="mt-2 d-flex flex-row">
      <div class="ml-2 text-truncate position-relative">
        <span class="small cm-dot-primary mr-2">${dept.deptName}</span>
        <span class="small cm-dot-primary mr-2">${dept.count}</span>
        <span class="small cm-dot-primary mr-2">${dept.score}</span>
      </div>
    </div>
    [/#list]
    [/@ZContentScoreStat]
  </div>
  [/#if]
</div>
[/#escape]
<style>
  .share {
    position: fixed;
    bottom: 240px;
    right: 20px;
    z-index: 999;
  }
  .share .help {
    background-color: transparent !important;
    width: auto;
    height: auto;
    padding: 0;
  }
  .link-floatnav-service {
     display: block;
     width: 70px;
     padding-top: 70px;
     background: url('${resource}/static/img/ai-assistant.png') no-repeat center bottom;
   }
  .link-floatnav-service-span{
    margin-top: 20px;
  }
</style>